package cn.iocoder.yudao.module.scrm.enums;

import cn.iocoder.yudao.framework.common.exception.ErrorCode;
// TODO 待办：请将下面的错误码复制到 yudao-module-scrm-api 模块的 ErrorCodeConstants 类中。注意，请给“TODO 补充编号”设置一个错误码编号！！！
// ========== 线索 TODO 补充编号 ==========
/**
 * scrm 错误码枚举类
 *
 * scrm 系统，使用 1_099_000_000 段
 * @Author LiZhiMin
 * @Date 2024/5/15 18:23
 */

public interface ErrorCodeConstants {
    // ========== 线索 1-099-001-000 ==========
    ErrorCode CLUE_NOT_EXISTS = new ErrorCode(1_099_001_000, "线索不存在");


    ErrorCode CLUE_IMPORT_NOT_IS_EMPTY = new ErrorCode(1_099_001_001, "导入线索-数据不能为空！");


    ErrorCode CLUE_IMPORT_FORMAT_ERROR = new ErrorCode(1_099_001_001, "导入线索的-Excel格式不对，请下载模板按照模板填写数据！");

    ErrorCode CUSTOMER_IMPORT_FORMAT_ERROR = new ErrorCode(1_099_001_001, "导入线索的-Excel格式不对，请下载模板按照模板填写数据！");

    ErrorCode CLUE_IMPORT_NAME_NOT_IS_EMPTY = new ErrorCode(1_099_001_002, "导入数据中姓名不能为空！");
    ErrorCode CLUE_IMPORT_PHONE_NAME_NOT_IS_EMPTY = new ErrorCode(1_099_001_003, "导入数据中姓名和手机号码不能为空！");
    ErrorCode CLUE_IMPORT_PHONE_NOT_IS_EMPTY = new ErrorCode(1_099_001_004, "导入数据中手机号码不能为空！");

    ErrorCode CLUE_IMPORT_PHONE_EXIST_BY_OTHER_PEOPLE = new ErrorCode(1_099_001_004, "导入的数据中手机号码为【{}】的线索已经存在，在负责人【{}】的线索中");

    ErrorCode CUSTOMER_IMPORT_PHONE_EXIST_BY_OTHER_PEOPLE = new ErrorCode(1_099_001_004, "导入的数据中手机号码为【{}】的线索已经存在，于【{}】被 【{}】 添加");
    ErrorCode CUSTOMER_IMPORT_PHONE_EXIST_BY_OTHER_PEOPLE_PUBLIC = new ErrorCode(1_099_001_004, "导入的数据中手机号码为【{}】的客户已经存在于公海中请去公海中领取客户");

    ErrorCode OPERATE_RECORD_NOT_EXISTS = new ErrorCode(1_099_001_005, "操作记录不存在！");

    ErrorCode CLUE_NAME_EXISTS = new ErrorCode(1_099_001_006, "已存在手机号码为【{}】的线索！");

    ErrorCode CUSTOMER_NAME_EXISTS = new ErrorCode(1_099_001_006, "已存在手机号码为【{}】的客户！");

    // ========== 订单 1-099-002-000 ==========
    ErrorCode ORDER_NOT_EXISTS = new ErrorCode(1_099_001_000, "订单不存在");

    ErrorCode ORDER_NOT_REPETITION_SUBMIT = new ErrorCode(1_099_001_000, "该订单已经提交流程了-不能进行修改了");


    ErrorCode CLUE_SELECT_IDS = new ErrorCode(1_099_001_000, "请选择线索");


    // 自定义字段
    ErrorCode SYSTEM_NUMBER_NOT_EXISTS = new ErrorCode(1_999_000_001, "系统编号不存在");

    // 客户
    ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(1_001_001, "客户不存在");

    ErrorCode CUSTOMER_UPDATE_DEAL_STATUS_FAIL = new ErrorCode(1_001_002, "更新客户的成交状态失败，原因：已经是该状态，无需更新");


    // ========== 合同管理 1-020-000-000 ==========
    ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(1_020_000_000, "合同不存在");
    ErrorCode CONTRACT_UPDATE_FAIL_NOT_DRAFT = new ErrorCode(1_020_000_001, "合同更新失败，原因：合同不是草稿状态");
    ErrorCode CONTRACT_SUBMIT_FAIL_NOT_DRAFT = new ErrorCode(1_020_000_002, "合同提交审核失败，原因：合同没处在未提交状态");
    ErrorCode CONTRACT_UPDATE_AUDIT_STATUS_FAIL_NOT_PROCESS = new ErrorCode(1_020_000_003, "更新合同审核状态失败，原因：合同不是审核中状态");
    ErrorCode CONTRACT_NO_EXISTS = new ErrorCode(1_020_000_004, "生成合同序列号重复，请重试");

    // ========== 线索管理 1-020-001-000 ==========

    ErrorCode CLUE_TRANSFORM_EXIST_CUSTOMER_PHONE = new ErrorCode(1_020_001_001, "手机号为:【{}】 的线索在客户中已经存在，负责人是：【{}】 ");

    ErrorCode CLUE_REPETITION_EXIST_PHONE = new ErrorCode(1_020_001_001, "手机号为:【{}】 的线索已经在别人的线索中了，负责人是：【{}】 ");

    ErrorCode CLUE_REPETITION_CUSTOMER_PHONE = new ErrorCode(1_020_001_001, "手机号为:【{}】 的客户已经在别人的客户中了，负责人是：【{}】 ");
    ErrorCode CLUE_TRANSFORM_EXIST_PUBLIC_CUSTOMER_PHONE = new ErrorCode(1_020_001_001, "手机号为:【{}】 的线索已经在公海中存在了");

    ErrorCode CLUE_PHONE_EXIST_BY_USER_ID_NOT = new ErrorCode(1_020_001_001, "手机号为:【{}】 的客户已经存在，但是该人员id：【{}】已经被删除了");

    ErrorCode CLUE_TRANSFORM_FAIL_ALREADY = new ErrorCode(1_020_001_001, "姓名为:【{}】 的线索,已经转为客户了，请勿重复转化");
    ErrorCode CLUE_OPERATION_FAIL_ALREADY = new ErrorCode(1_020_001_001, "姓名为:【{}】 的线索,已经转为客户了，不能进行操作");
    ErrorCode CLUE_INVALID_FAIL_ALREADY = new ErrorCode(1_020_001_001, "姓名为:【{}】 的线索,为无效线索，请更改状态后在进行转移");

    // ========== 商机管理 1-020-002-000 ==========
    ErrorCode BUSINESS_NOT_EXISTS = new ErrorCode(1_020_002_000, "商机不存在");
    ErrorCode BUSINESS_DELETE_FAIL_CONTRACT_EXISTS = new ErrorCode(1_020_002_001, "商机已关联合同，不能删除");
    ErrorCode BUSINESS_UPDATE_STATUS_FAIL_END_STATUS = new ErrorCode(1_020_002_002, "更新商机状态失败，原因：已经是结束状态");
    ErrorCode BUSINESS_UPDATE_STATUS_FAIL_STATUS_EQUALS = new ErrorCode(1_020_002_003, "更新商机状态失败，原因：已经是该状态");


    // ========== 营销管理 1-020-002-000 ==========
    ErrorCode MARKETING_CATEGORY_NOT_EXISTS = new ErrorCode(1_020_002_003, "营销分类不存在");
    ErrorCode MARKETING_CONTENT_NOT_EXISTS = new ErrorCode(1_020_002_003, "营销内容不存在");
    ErrorCode MARKETING_TRANSMIT_NOT_EXISTS = new ErrorCode(1_020_002_003, "营销转发不存在");
    ErrorCode MARKETING_VISITOR_NOT_EXISTS = new ErrorCode(1_020_002_003, "营销访客数据不存在");

    ErrorCode MARKETING_LOOK_NOT_EXISTS = new ErrorCode(1_020_002_003, "营销访客数据不存在");

    ErrorCode MARKETING_CONTENT_SHARE_ONE = new ErrorCode(1_020_002_005, "转发的内容已过期，请重新分享");

    ErrorCode MARKETING_CONTENT_SHARE_TWO = new ErrorCode(1_020_002_005, "转发的内容不存在，请重新分享");

    ErrorCode MARKETING_CONTENT_SHARE_THREE = new ErrorCode(1_020_002_005, "分享的内容已经过期了，请重新分享");

    ErrorCode MARKETING_CONTENT_SHARE_FOUR = new ErrorCode(1_020_002_005, "分享的内容不存在了，请重新分享");






    // ========== 联系人管理 1-020-003-000 ==========
    ErrorCode CONTACT_NOT_EXISTS = new ErrorCode(1_020_003_000, "联系人不存在");
    ErrorCode CONTACT_DELETE_FAIL_CONTRACT_LINK_EXISTS = new ErrorCode(1_020_003_002, "联系人已关联合同，不能删除");
    ErrorCode CONTACT_UPDATE_OWNER_USER_FAIL = new ErrorCode(1_020_003_003, "更新联系人负责人失败");

    // ========== 回款 1-020-004-000 ==========
    ErrorCode RECEIVABLE_NOT_EXISTS = new ErrorCode(1_020_004_000, "回款不存在");
    ErrorCode RECEIVABLE_UPDATE_FAIL_EDITING_PROHIBITED = new ErrorCode(1_020_004_001, "更新回款失败，原因：禁止编辑");
    ErrorCode RECEIVABLE_DELETE_FAIL = new ErrorCode(1_020_004_002, "删除回款失败，原因： 被回款计划所使用，不允许删除");
    ErrorCode RECEIVABLE_SUBMIT_FAIL_NOT_DRAFT = new ErrorCode(1_020_004_003, "回款提交审核失败，原因：回款没处在未提交状态");
    ErrorCode RECEIVABLE_UPDATE_AUDIT_STATUS_FAIL_NOT_PROCESS = new ErrorCode(1_020_004_004, "更新回款审核状态失败，原因：回款不是审核中状态");
    ErrorCode RECEIVABLE_NO_EXISTS = new ErrorCode(1_020_004_005, "生成回款序列号重复，请重试");
    ErrorCode RECEIVABLE_CREATE_FAIL_CONTRACT_NOT_APPROVE = new ErrorCode(1_020_004_006, "创建回款失败，原因：合同不是审核通过状态");
    ErrorCode RECEIVABLE_CREATE_FAIL_PRICE_EXCEEDS_LIMIT = new ErrorCode(1_020_004_007, "创建回款失败，原因：回款金额超出合同金额，目前剩余可退：{} 元");

    // ========== 回款计划 1-020-005-000 ==========
    ErrorCode RECEIVABLE_PLAN_NOT_EXISTS = new ErrorCode(1_020_005_000, "回款计划不存在");
    ErrorCode RECEIVABLE_PLAN_UPDATE_FAIL = new ErrorCode(1_020_006_000, "更想回款计划失败，原因：已经有对应的还款");
    ErrorCode RECEIVABLE_PLAN_EXISTS_RECEIVABLE = new ErrorCode(1_020_006_001, "回款计划已经有对应的回款，不能使用");

    // ========== 客户管理 1_020_006_000 ==========

    ErrorCode CUSTOMER_IMPORT_NOT_IS_EMPTY = new ErrorCode(1_099_111_888, "导入客户-数据不能为空！");
    ErrorCode CUSTOMER_OWNER_EXISTS = new ErrorCode(1_020_006_001, "客户【{}】已存在所属负责人");
    ErrorCode CUSTOMER_LOCKED = new ErrorCode(1_020_006_002, "客户【{}】状态已锁定");
    ErrorCode CUSTOMER_ALREADY_DEAL = new ErrorCode(1_020_006_003, "客户已交易");
    ErrorCode CUSTOMER_IN_POOL = new ErrorCode(1_020_006_004, "客户【{}】放入公海失败，原因：已经是公海客户");
    ErrorCode CUSTOMER_LOCKED_PUT_POOL_FAIL = new ErrorCode(1_020_006_005, "客户【{}】放入公海失败，原因：客户已锁定");
    ErrorCode CUSTOMER_UPDATE_OWNER_USER_FAIL = new ErrorCode(1_020_006_006, "更新客户【{}】负责人失败, 原因：系统异常");
    ErrorCode CUSTOMER_LOCK_FAIL_IS_LOCK = new ErrorCode(1_020_006_007, "锁定客户失败，它已经处于锁定状态");
    ErrorCode CUSTOMER_UNLOCK_FAIL_IS_UNLOCK = new ErrorCode(1_020_006_008, "解锁客户失败，它已经处于未锁定状态");
    ErrorCode CUSTOMER_LOCK_EXCEED_LIMIT = new ErrorCode(1_020_006_009, "您锁定的客户已达到最高额度，请解锁其它客户之后在重新锁定");



    ErrorCode CUSTOMER_OWNER_EXCEED_LIMIT = new ErrorCode(1_020_006_010, "操作失败，超出客户数拥有上限");
    ErrorCode CUSTOMER_DELETE_FAIL_HAVE_REFERENCE = new ErrorCode(1_020_006_011, "删除客户失败，有关联{}");
    ErrorCode CUSTOMER_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_020_006_012, "导入客户数据不能为空！");
    ErrorCode CUSTOMER_CREATE_NAME_NOT_NULL = new ErrorCode(1_020_006_013, "客户名称不能为空！");

    ErrorCode CUSTOMER_TRANSFER_NOT_NULL = new ErrorCode(1_020_006_014, "客服负责人不能为空！");

    // ========== 权限管理 1_020_007_000 ==========
    ErrorCode CRM_PERMISSION_NOT_EXISTS = new ErrorCode(1_020_007_000, "数据权限不存在");
    ErrorCode CRM_PERMISSION_DENIED = new ErrorCode(1_020_007_001, "{}操作失败，原因：没有权限");
    ErrorCode CRM_PERMISSION_MODEL_TRANSFER_FAIL_OWNER_USER_EXISTS = new ErrorCode(1_020_007_003, "{}操作失败，原因：转移对象已经是该负责人");
    ErrorCode CRM_PERMISSION_DELETE_FAIL = new ErrorCode(1_020_007_004, "删除数据权限失败，原因：批量删除权限的时候，只能属于同一个 bizId 下");
    ErrorCode CRM_PERMISSION_DELETE_DENIED = new ErrorCode(1_020_007_006, "删除数据权限失败，原因：没有权限");
    ErrorCode CRM_PERMISSION_DELETE_SELF_PERMISSION_FAIL_EXIST_OWNER = new ErrorCode(1_020_007_007, "删除数据权限失败，原因：不能删除负责人");
    ErrorCode CRM_PERMISSION_CREATE_FAIL = new ErrorCode(1_020_007_008, "创建数据权限失败，原因：所加用户已有权限");

    // ========== 产品 1_020_008_000 ==========
    ErrorCode PRODUCT_NOT_EXISTS = new ErrorCode(1_020_008_000, "产品不存在");
    ErrorCode PRODUCT_NO_EXISTS = new ErrorCode(1_020_008_001, "产品编号已存在");
    ErrorCode PRODUCT_NOT_ENABLE = new ErrorCode(1_020_008_002, "产品【{}】已禁用");

    // ========== 产品分类 1_020_009_000 ==========
    ErrorCode PRODUCT_CATEGORY_NOT_EXISTS = new ErrorCode(1_020_009_000, "产品分类不存在");
    ErrorCode PRODUCT_CATEGORY_EXISTS = new ErrorCode(1_020_009_001, "产品分类已存在");
    ErrorCode PRODUCT_CATEGORY_USED = new ErrorCode(1_020_009_002, "产品分类已关联产品");
    ErrorCode PRODUCT_CATEGORY_PARENT_NOT_EXISTS = new ErrorCode(1_020_009_003, "父分类不存在");
    ErrorCode PRODUCT_CATEGORY_PARENT_NOT_FIRST_LEVEL = new ErrorCode(1_020_009_004, "父分类不能是二级分类");
    ErrorCode product_CATEGORY_EXISTS_CHILDREN = new ErrorCode(1_020_009_005, "存在子分类，无法删除");

    // ========== 商机状态 1_020_010_000 ==========
    ErrorCode BUSINESS_STATUS_TYPE_NOT_EXISTS = new ErrorCode(1_020_010_000, "商机状态组不存在");
    ErrorCode BUSINESS_STATUS_TYPE_NAME_EXISTS = new ErrorCode(1_020_010_001, "商机状态组的名称已存在");
    ErrorCode BUSINESS_STATUS_UPDATE_FAIL_USED = new ErrorCode(1_020_010_002, "已经被使用的商机状态组，无法进行更新");
    ErrorCode BUSINESS_STATUS_DELETE_FAIL_USED = new ErrorCode(1_020_010_002, "已经被使用的商机状态组，无法进行删除");
    ErrorCode BUSINESS_STATUS_NOT_EXISTS = new ErrorCode(1_020_010_003, "商机状态不存在");

    // ========== 客户公海规则设置 1_020_012_000 ==========
    ErrorCode CUSTOMER_LIMIT_CONFIG_NOT_EXISTS = new ErrorCode(1_020_012_001, "客户限制配置不存在");

    // ========== 跟进记录 1_020_013_000 ==========
    ErrorCode FOLLOW_UP_RECORD_NOT_EXISTS = new ErrorCode(1_020_013_000, "跟进记录不存在");
    ErrorCode FOLLOW_UP_RECORD_DELETE_DENIED = new ErrorCode(1_020_013_001, "删除跟进记录失败，原因：没有权限");



    // 自定义字段
    ErrorCode CUSTOMIZE_PROPERTY_NOT_EXISTS = new ErrorCode(1_060_000_001, "属性不存在");

    // 协助人
    ErrorCode CUSTOMER_ASSISTANTS_NOT_EXISTS = new ErrorCode(1_060_000_002, "协助人不存在");

    ErrorCode CUSTOMER_ASSISTANTS_USER_ID_OR_WX_ID_REQUIRED = new ErrorCode(1_060_000_003, "协助人不存在");

    ErrorCode REFUND_NOT_EXISTS = new ErrorCode(1_060_000_004, "退款不存在");

    ErrorCode INVOICE_NOT_EXISTS = new ErrorCode(1_060_000_005, "发票不存在");

    ErrorCode TEACHER_NOT_EXISTS = new ErrorCode(1_060_000_006, "老师不存在");

    ErrorCode SCHEDULES_NOT_EXISTS = new ErrorCode(1_060_000_007, "排期不存在");

    ErrorCode SCHEDULES_NOT_ENABLE = new ErrorCode(1_060_000_010, "排期不可用");

    ErrorCode SCHEDULES_CUSTOMER_NOT_EXISTS = new ErrorCode(1_060_000_008, "排期客户不存在");

    ErrorCode SCHEDULES_TEACHER_NOT_EXISTS = new ErrorCode(1_060_000_009, "排期老师不存在");

    ErrorCode SCHEDULES_VISITOR_NOT_EXISTS = new ErrorCode(1_060_000_010, "排期访客不存在");

    //比较报错信息
    ErrorCode COMPARE_ORDER_RECEIVABLE = new ErrorCode(2_099_666_001, "已经存在的回款金额：【{}】 + 你填写的金额：【{}】 = 【{}】，不能大于订单总金额：【{}】，你最大能填写的金额为：【{}】");

    ErrorCode COMPARE_ORDER_INVOICES = new ErrorCode(2_099_666_002, "已经存在的发票金额：【{}】 + 你填写的金额：【{}】= 【{}】，不能大于订单总金额：【{}】，你最大能填写的金额为：【{}】");

    ErrorCode COMPARE_ORDER_INVOICES_REFUND = new ErrorCode(2_099_666_002, "该订单下面已存在回款|发票|退款请先删除后在更改订单金额。 你可以根据订单编号：【{}】 查询对应的回款|发票|退款进行删除后在修改订单总金额");
    ErrorCode COMPARE_STRATEGY_TYPE = new ErrorCode(2_099_666_003, "找不到这个策略类型：{}");

    ErrorCode COMPARE_STRATEGY_TYPE_NOT_NULL = new ErrorCode(2_099_666_004, "策略类型不能为空，请联系管理员");


    ErrorCode ORDER_EXIST_RECEIVABLE = new ErrorCode(1_001_001, "该订单下面存在回款，请先根据订单编号：【{}】 删除对应的回款在删除订单");
    ErrorCode ORDER_EXIST_REFUND= new ErrorCode(1_001_001, "该订单下面存在退款，请先根据订单编号：【{}】 删除对应的退款在删除订单");
    ErrorCode ORDER_EXIST_INVOICE = new ErrorCode(1_001_001, "该订单下面存在发票，请先根据订单编号：【{}】 删除对应的发票在删除订单");
    ErrorCode PHONE_ENCRYPTOR_NOT_EXISTS = new ErrorCode(10_001_001, "客户手机加密配置不存在");

    ErrorCode CUSTOMER_EXIST_RELEVANT_DATA = new ErrorCode(666_888_999, "删除失败（您还有关联的线索或者商机或者排期客户或者订单未删除）");

    //客户库设置
    ErrorCode CUSTOMER_REPOSITORY_NOT_EXISTS = new ErrorCode(1_088_066_001, "客户库不存在");
    ErrorCode CUSTOMER_REPOSITORY_RULE_NOT_EXISTS = new ErrorCode(1_088_066_002, "客户规则不存在");

    ErrorCode CUSTOMER_UNLOCK_FAILING = new ErrorCode(1_088_066_003, "解锁客户失败，只能解锁自己负责的客户");

    ErrorCode CUSTOMER_LOCK_FAILING = new ErrorCode(1_088_066_004, "锁定客户失败，只能锁定自己负责的客户");

    ErrorCode CUSTOMER_REPOSITORY_HAVE_RULE_NOT_UPDATE = new ErrorCode(1_009_006_005, "请先删除该客户库下面的规则在进行修改");

    ErrorCode CUSTOMER_REPOSITORY_CONFIG_DEPT_SCOPE = new ErrorCode(1_009_006_006, "请先给客户库配置部门范围在配置规则的部门的范围");

    ErrorCode CUSTOMER_REPOSITORY_ALL_DEPTS_USED = new ErrorCode(1_009_006_006, "当前客户库中的所有部门已经被使用了不能在新增规则了");

    ErrorCode CUSTOMER_REPOSITORY_COUNT_LIMIT = new ErrorCode(1_009_006_006, "您转移的人的私库容量已经到达上限，请要他移除他名下的客户才可以将可以转移给他");

    ErrorCode CUSTOMER_REPOSITORY_COUNT_LIMIT_BY_RECEIVE = new ErrorCode(1_009_006_006, "您的私库容量已经到达上限，请转移客户后再重新领取");

    ErrorCode CUSTOMER_REPOSITORY_COUNT_LIMIT_BY_CREATE = new ErrorCode(1_009_006_006, "您的私库容量已经到达上限，请转移客户后再重新添加");


    ErrorCode CUSTOMER_DEPT_USE = new ErrorCode(1_088_066_001, "您选择的部门已经被其它人选择了请重新选择");
}

